package org.kzwl.book.controller.app;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.kzwl.comm.pojo.ResponseData;
import org.kzwl.comm.pojo.bo.category.CategoryBasic;
import org.kzwl.comm.pojo.dto.UserLoginDTO;
import org.kzwl.comm.pojo.dto.category.CategoryDTO;
import org.kzwl.comm.pojo.dto.user.UserTokenDTO;
import org.kzwl.entity.app.Category;
import org.kzwl.service.app.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 张国伟/郭家恒
 * @since 2020-09-10
 */
@RestController
@RequestMapping("/category")
@Api("分类")
public class CategoryController {

    @Autowired
    CategoryService categoryService;

    @GetMapping("/queryAll")
    public ResponseData<List<Category>> queryAll() {
        return categoryService.queryAll();
    }

    @ApiOperation(value = "基础查询")
    @PostMapping("/queryBasic")
    public ResponseData<List<CategoryDTO>> queryBasic(@RequestBody CategoryBasic bo) {
        List<CategoryDTO> list = categoryService.queryBasic(bo);
        return new ResponseData<>(list);
    }

}
